<template>
  <ContentWrap
    class="mb-0!"
    :class="[
      footer
        ? '!h-[calc(100vh-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height)-10px)]'
        : '!h-[calc(100vh-var(--top-tool-height)-var(--tags-view-height)-20px)]'
    ]"
    :bodyStyle="{ height: '100%', padding: '10px' }"
  >
    <div class="flex flex-col !h-full justify-between">
      <el-scrollbar viewClass="flex-grow ">
        <el-row>
          <el-col :span="24">
            <div class="custom-text-18 mb-10px"> 寄存员工 </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
          <el-popover
            placement="top-start"
            title="寄存员工"
            :width="200"
            trigger="hover"
            :content="cartEmployeeText"
          >
            <template #reference>
              <div class="custom-text-16">
                <el-text line-clamp="1"> {{ cartEmployeeText }} </el-text>
              </div>
            </template>
          </el-popover>

          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
        <el-row>
          <el-col :span="24">
            <div class="custom-text-18"> 寄存信息 </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>

        <!-- 订单优惠 -->

        <el-row v-for="(item, index) in orderPayload.items" :key="index">
          <el-col :span="24">
            <div class="flex justify-between custom-text-14">
              <div> {{ item.spuName }} </div>
              <div> <span>x</span>{{ item.count }} </div>
            </div>
          </el-col>
          <el-divider border-style="dashed" class="mb-10px! mt-10px!" />
        </el-row>
      </el-scrollbar>
      <div class="flex justify-end">
        <slot name="button"></slot>
      </div>
    </div>
  </ContentWrap>
</template>
<script setup lang="ts" name="orderInfo">
/** 购物车信息 */
import { propTypes } from '@/utils/propTypes'
import { useAppStore } from '@/store/modules/app'
const appStore = useAppStore()
const footer = computed(() => appStore.getFooter)
import { useShopDepositWithOut } from '@/store/modules/shop/deposit'
const shopDeposit = useShopDepositWithOut()
const orderPayload = computed(() => {
  return shopDeposit.getOrderPayload
})

defineProps({
  cartEmployeeText: propTypes.string.def('')
})
</script>
